package com.stu.initconfig.interceptor;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import com.stu.utils.CommonUtils;

/**
 * session 拦截
 * @author lijian
 *
 */
public class SessionInterceptor extends MethodFilterInterceptor {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected String doIntercept(ActionInvocation actionInvocation) throws Exception {
		
		Object sessionInfo = CommonUtils.getSessionAttribute("currentUser");
		/*if (sessionInfo == null) { 
			ServletActionContext.getRequest().setAttribute("msg", "您还没有登录或登录已超时，请重新登录，然后再刷新本功能！");
//			 CommonUtils.getResponse().sendRedirect("www.baidu.com"); 
//			 System.out.println("SessionInterceptor.doIntercept()");
//			 out.write("<html><script type='text/javascript'>window.open('"+login+"','_top');</script></html>");
			return "noSession";
		}*/
		return actionInvocation.invoke();
	}

}
